﻿@ModelType IEnumerable(Of MvcMusicStoreVB.Models.Album)
@Imports MvcMusicStoreVB.Helpers

@Code
    ViewBag.Title = "Index"
End Code

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p> 
<table>
    <tr>
        <th></th>
        <th>Title</th>
        <th>Artist</th>
        <th>Genre</th>
    </tr>

@For Each item In Model
    @<tr>
        <td>
            @Html.ActionLink("Edit", "Edit", New With {.id = item.AlbumId}) |
            @Html.ActionLink("Delete", "Delete", New With {.id = item.AlbumId})
        </td>
        <td>@Html.Truncate(item.Title, 25)</td>
        <td>@Html.Truncate(item.Artist.Name, 25)</td>
        <td>@item.Genre.Name</td>
    </tr>
Next

</table>

